
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<div class="center_content">
    <div class="center_title_bar">Sign Up </div>
    <div class="prod_box_big">
        <div class="top_prod_box_big"></div>
        <div class="center_prod_box_big">
            <div class="contact_form">
                <form action="ProfileUpdating" method="post" name="myform" id="myform">
                    <div class="form_row">
                        <div id='myform_firstName_errorloc' class="error_strings"></div>
                        <label class="contact"><strong>First Name:</strong></label>
                        <input type="text" name="firstName" class="contact_input" value="<c:out value="${sessionScope.user.firstName}"/>"/>
                    </div>
                    <div class="form_row">
                        <div id='myform_lastName_errorloc' class="error_strings"></div>
                        <label class="contact"><strong>Last Name:</strong></label>
                        <input type="text" name="lastName" class="contact_input" value="<c:out value="${sessionScope.user.lastName}"/>"/>
                    </div>
                    
                    <div class="form_row">
                        <label class="contact"><strong>Birth Date:</strong></label>
                        <select name="year">
                            <option value="2010">2010</option>
                            <option value="2009">2009</option>
                            <option value="2008">2008</option>
                            <option value="2007">2007</option>
                            <option value="2006">2006</option>
                            <option value="2005">2005</option>
                            <option value="2004">2004</option>
                            <option value="2003">2003</option>
                            <option value="2002">2002</option>
                            <option value="2001">2001</option>
                        </select>
                        <select name="month">
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                        </select>
                        <select name="Day">
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                        </select>
                    </div>
                    <div class="form_row">
                        <div id='myform_userMail_errorloc' class="error_strings"></div>
                        <label class="contact"><strong>Mail:</strong></label>
                        <input type="text" name="userMail" class="contact_input" value="<c:out value="${sessionScope.user.userMail}"/>"/>
                    </div>
                     <div class="form_row">
                         <div id='myform_userPassword_errorloc' class="error_strings"></div>
                        <label class="contact"><strong>Password:</strong></label>
                        <input type="text" name="userPassword" class="contact_input" value=" <c:out value="${sessionScope.user.userPassword}"/>"/>
                    </div>
                    <div class="form_row">
                        <div id='myform_userAddress_errorloc' class="error_strings"></div>
                        <label class="contact"><strong>Address:</strong></label>
                        <input type="text" name="userAddress" class="contact_input" value="<c:out value="${sessionScope.user.userAddress}"/>" />
                    </div>
                    <div class="form_row">
                        <div id='myform_userMobile_errorloc' class="error_strings"></div>
                        <label class="contact"><strong>Mobile:</strong></label>
                        <input type="text" name="userMobile" class="contact_input" value="<c:out value="${sessionScope.user.userMobile}"/>"/>
                    </div>
                    
                    <div class="form_row">
                        <div id='myform_userCredit_errorloc' class="error_strings"></div>
                        <label class="contact"><strong>Credit Limit :</strong></label>
                        <input type="text" name="userCredit" class="contact_input" value="<c:out value="${sessionScope.user.userCredit}"/>"/>
                    </div>
                    <div class="form_row"> <input type="submit" value="Update Profile"></div>
                </form>
            </div>
        </div>
        <div class="bottom_prod_box_big"></div>
    </div>
</div>
<script language="JavaScript" type="text/javascript">//<![CDATA[
//You should create the validator only after the definition of the HTML form
  var frmvalidator  = new Validator("myform");
    frmvalidator.EnableOnPageErrorDisplay();
    frmvalidator.EnableMsgsTogether();

    frmvalidator.addValidation("firstName","req","Please enter your First Name");
    frmvalidator.addValidation("firstName","alpha_s","First Name can contain alphabetic chars only");
    
    frmvalidator.addValidation("lastName","req","Please enter your Last Name");
    frmvalidator.addValidation("lastName","alpha_s","Last Name can contain alphabetic chars only");

    frmvalidator.addValidation("userMail","maxlen=50");
    frmvalidator.addValidation("userMail","req");
    frmvalidator.addValidation("userMail","email");
    
    frmvalidator.addValidation("userPassword","req","Please enter your Password");
    frmvalidator.addValidation("userPassword","neelmnt=firstName","The password should not be same as username");
    
    frmvalidator.addValidation("userAddress","req","Please enter your Address");
    frmvalidator.addValidation("userAddress","maxlen=100","minlen=4",	"Max length for UserName is 100");
    
    frmvalidator.addValidation("userMobile","req","Please enter your Mobile");
    frmvalidator.addValidation("userMobile","numeric");
    
    frmvalidator.addValidation("userCredit","req","Please enter your Credite Balance");
    frmvalidator.addValidation("userCredit","numeric");
    frmvalidator.addValidation("userCredit","gtelmnt=2","Credite Balance  should be larger than 2 numbers");
//]]></script>                
